<%@ include file="/taglib-imports.jspf" %>

<tiles:insert definition="backend.layout">
    <%@ include file="/edu/uoc/tfc/gui/parts/cerca-part-dades-javascript.jspf" %>

    <tiles:put name="body" type="string">
		<%@ include file="/edu/uoc/tfc/gui/parts/cerca-part-dades-cerca-parts.jspf" %>
		
		<emkt:dataTables
			tableName="buscarParts"
			action="/CUCercaParts/CercaPartDadesCercaParts.do"
			columnNames="dto.part.codiPart,dto.part.dataSinistre,dto.part.baseImposable,dto.part.percentatgeIva,dto.part.obert"
			columnAttributes="codiPart,dataSinistre,baseImposable,percentatgeIva,obert"
			columnWidths="25,25,20,20,10"
			footer="true"
			searchOnLoad="false"
			prettyWrite="true"
			bytoken="false">
		
			<authz:authorize ifAnyGranted="ROLE_PERIT">	
				<emkt:ajaxButton
					iconClass="icon-plus-sign"
					label="datatables.newPart"
					operation="/CUCercaParts/CercaPartDadesAltaPart.do"					
					bytoken="false"
					modalClass="modal-emkt-big"
				/>				
				<emkt:dataTablesButton
					iconClass="icon-pencil"
					label="datatables.edit"
					operation="/CUCercaParts/CercaPartDadesModificaPart.do"
					columnName="id"					
					readonly="false"
					bytoken="false"
					modalClass="modal-emkt-big"
					actionType="isTancat"
				/>				
				<emkt:dataTablesButton
					iconClass="icon-print"
					label="datatables.printPart"
					operation="/CUCercaParts/CercaPartDadesImprimirPart.do"
					columnName="id"
					readonly="false"
					bytoken="false"
					modalClass="modal-emkt-medium"
				/>
				<emkt:dataTablesButton
					iconClass="icon-eye-close"
					label="datatables.tancarPart"
					operation="/CUCercaParts/CercaPartDadesTancaPart.do"
					columnName="id"					
					readonly="false"
					bytoken="false"
					modalClass="modal-emkt-medium"
					actionType="isTancat"
				/>				
			</authz:authorize>
			<authz:authorize ifAnyGranted="ROLE_FACTURACIO">
				<emkt:dataTablesButton
					iconClass="icon-print"
					label="datatables.printFactura"
					operation="/CUCercaParts/CercaPartDadesImprimirFactura.do"
					columnName="id"
					readonly="false"
					bytoken="false"
					modalClass="modal-emkt-medium"
					actionType="isNotTancat"
				/>
				<emkt:dataTablesButton
					iconClass="icon-eye-close"
					label="datatables.veureFactura"
					operation="/CUCercaParts/CercaPartDadesModificaPart.do"
					columnName="id"					
					readonly="false"
					bytoken="false"
					modalClass="modal-emkt-big"
					actionType="isNotTancat"
				/>								
			</authz:authorize>
		</emkt:dataTables>		
    </tiles:put>
</tiles:insert>